#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QTimer>
#include <QImage>
#include <QImageWriter>
#include <QGraphicsPixmapItem>
#include <QFileDialog>
#include <QDateTime>
#include <QList>
#include <QVideoEncoder.h>
#include <QVideoDecoder.h>
//#include <qvip.h>
//#include <QVMPlayerReader>
#include <qwt_slider.h>
//#include <signal.h>
#include "Qx3Model.hh"

namespace Ui {
    class MainWindow;
}

class MainWindow : public QMainWindow {
    Q_OBJECT
public:
    MainWindow(QWidget *parent = 0);
    ~MainWindow();

protected:
    void changeEvent(QEvent *e);
    void closeEvent(QCloseEvent *);
protected slots:
    void on_chkTopLight_toggled( bool state );
    void on_chkBottomLight_toggled( bool state );
    void on_t_timeout();
    void on_slideBrightness_valueChanged( int  brightness);
    void on_slideColor_valueChanged( int color);
    void on_slideContrast_valueChanged(int contrast);
    void on_slideRedGain_valueChanged(double redGainValue);
    void on_slideGreenGain_valueChanged(double greenGainValue);
    void on_slideBlueGain_valueChanged(double blueGainValue);
    void on_slideQuality_valueChanged(int quality);
    void on_slideVideoPosition_valueChanged(double position);
    void on_chkFreeze_toggled( bool freeze );
    void on_btnSnap_clicked();
    void on_Qx3Model_buttonPressed();
    void on_Qx3Model_cradleChanged(bool cradlestate);
    void on_actionAbout_triggered();
    void on_btnRecord_clicked();
    void on_btnStop_clicked();
    void on_btnPlay_clicked();
private:
    Ui::MainWindow *ui;
    QTimer *t;
    QGraphicsPixmapItem *gvPixmap;
    bool record;
    bool play;
    bool paused;
    //QVMPlayerReader videoReader;
    QFile *videoFile;
    int currentFrame;
    int framenumber;
    QVideoEncoder encoder;
    QVideoDecoder decoder;
    QString currentFileName;
};

#endif // MAINWINDOW_H
